﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using ProjManagSolution.pmMyWebService;

namespace ProjManagSolution
{
    public partial class AssignRole : ChildWindow
    {
        protected Member currentUser = new Member();

        public AssignRole(Member curUser)
        {
            InitializeComponent();
            currentUser = curUser;
            
            //show current info
            showInfo();

        }

        private void showInfo()
        {
            txtblokMemberEmail.Text = currentUser.Email;
        }

        protected bool Input_Validate()
        {
            if (comboRole.SelectedIndex <= 0)
            {
                MessageBox.Show("Please select a role!");
                return false;
            }
            return true;
        }
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if(Input_Validate())
                this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

